/*****************************************************************************
 * Please See the declaration in the bottom of this file.
 *
 *
 * Version			Date				Comment
 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Init(0)			2007.10.29 
 *****************************************************************************/
#ifndef		__IIC_H__
#define		__IIC_H__


extern void IICInit(unsigned char IICSetting);
extern void IICDisable(void);
extern void IIC_SendStart(unsigned char ControlByte);
extern void IIC_SendRestart(unsigned char ControlByte);
extern void IICEE_ByteWrite(unsigned char Block, unsigned char Address, unsigned char WriteData);
extern void IICEE_PageWrite(unsigned char Block, unsigned char Address, unsigned char N, unsigned char *DataBuffer);
extern void IIC_TransmitByte(unsigned char TxData);
extern void IICEE_SeqRead(unsigned char Block, unsigned char Address, unsigned int N, unsigned char *DataBuffer);

extern unsigned char IIC_ReceiveByte(bit ACKStatus);
extern unsigned char IICEE_CurrentRead(unsigned char Block);
extern unsigned char IICEE_RandomRead(unsigned char Block, unsigned char Address);



//===============================
//DEFINITIONs
//===============================
#define		ACK		0
#define		NACK		1
#define		SEL_IICA1	0
#define		SEL_IICA2	1
#define		EE_BLOCK0	0		// For 24LC/AA04B EEPROM, there are two blocks. 256 bytes each.
#define		EE_BLOCK1	0x02		// The higher block.



//===============================
//GLOBAL VARIABLES
//===============================
extern		bit 		IICEE_Error;




#endif









/*****************************************************************************
 * Processor:	SM59R16A2
 * Compiler:	Keil C 2.0
 *
 * Company:	SyncMOS Technologies International,Inc.
 * Author:	Stanley Huang
 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Board:	64-pin demo board (SDB0001A-0)
 * Purpose:
 *
 *
 *****************************************************************************/


